

public class Offer60 {
    public double[] dicesProbability(int n) {
        double[] dp = new double[]{1.0/6,1.0/6,1.0/6,1.0/6,1.0/6,1.0/6};
        for (int i = 2; i <= n; i++) {
            double[] temp = new double[5*i+1];
            for (int i1 = 0; i1 < dp.length; i1++) {
                for (int i2 = 0; i2 < 6; i2++) {
                    temp[i1+i2] += dp[i1]/6;
                }
            }
            dp = temp;
        }
        return dp;
    }
}
